package cn.webrx;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Reg7 {
    public static void main(String[] args) {
        //正则表达式对象，模式对象类，

        //? 相当于它前边的字符再现的次数 {0,1}
        Pattern p = Pattern.compile("\\d?");
        Matcher m = p.matcher("abc123java");
        System.out.println(m.matches()); //false
        System.out.println(m.find());//true




    }
}
